<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <canvas id="canvas" width="400" height="400"></canvas>
  <script>
    var canvas=document.querySelector("canvas")
    var ctx=canvas.getContext("2d")
    ctx.moveTo(200,100)
    ctx.lineTo(200,300)
    ctx.lineTo(300,300)
    ctx.lineTo(200,100)
    ctx.fill()
  </script>
</body>
</html>